//#define __DEBUG__
// by Tyrghen
#define THIS_FILE "fn_nearestObjType.sqf"
#include "x_setup.sqf"

private ["_type","_center","_radius","_nobjs","_return","_dist"];
PARAMS_3(_type,_center,_radius);
_return = objNull;
_dist = _radius * 3;
if (typename _type == typename "") then { _type = [_type]; };
_nobjs = nearestObjects [_center,_type,_radius];
if (count _nobjs > 0) then {
	_return = _nobjs select 0;
};
_return;